﻿<!--#include file="include/conn_f.asp"-->
<!--#include file="include/crypt.asp"-->
<!--#include file="include/function.asp"-->
<!--#include file="top.asp"-->
<!--#include file="left.asp"-->
<%
If Session("cust_id")="" Then
    Response.Write "请先登录会员,再使用此功能!"
    Response.End
End If
orders_id=saferequest("orders_id",1)
sql="select card_name,miane,orders.goods_type,total_amount,card_1_amount,order_time,"
sql=sql&"process_time,pay_status,pay_method,memo_cust,memo_tocust,status from orders left join card on "  
sql=sql&"orders.card_1=card.card_id left join card_infor on card.card_infor_id=card_infor.card_info_id where cust_id="&Session("cust_id")&" and orders.orders_id="&orders_id
Set rs=conn.execute(sql)
If Not rs.eof Then
    card_name=rs("card_name")
    g_key="850697"&g_key
%>
<table width="500" border="1" align="center" cellspacing="0" class="little">
    <tr>
        <td>
            定单号
        </td>
        <td>
            <%=orders_id%>
        </td>
    </tr>
    <% 
    If rs("goods_type")<>2 and rs("goods_type")<>5 and rs("goods_type")<>6	Then 
    %>
    <tr>
        <td>
            商品(卡)名称
        </td>
        <td>
            <%=rs("card_name")%>
        </td>
    </tr>
    <tr>
        <td>
            商品(卡)名称
        </td>
        <td>
            <%=rs("miane")%>
        </td>
    </tr>
    <tr>
        <td>
            数量
        </td>
        <td>
            <%=rs("card_1_amount")%>
        </td>
    </tr>
    <%
    End If
    Response.Write "<tr bgcolor=#FFFFFF><td>商品/服务类型</td><td>"
    select case rs("goods_type")
        case 0	Response.Write "卡密-e-mail/网站显示发送(可定单查询)"
        case 1	Response.Write "直充-充入您提供的相关帐号"
        case 2	Response.Write "代汇款/代购"
        card_name="汇款"
        case 3	Response.Write "邮寄"
        case 4	Response.Write "扫描-扫描好后通过e-mail发送"
        case 5	Response.Write "储值"
        case 6	Response.Write "游戏币"	
        card_name="储值"
        case Else	Response.Write "不详"
    end select	
    Response.Write "</td></tr>"
    If rs("goods_type")=1 Then
        sql_charge="select * from charge_detail where orders_id="&orders_id
        Set rs_charge=conn.execute(sql_charge)
        If Not rs_charge.eof Then
            Response.Write "<tr><td>充值帐号信息</td><td><table width='100%'>"
            Response.Write "<tr><td>游戏帐号：</td><td><font color=red>"&rs_charge("game_account")&"</font></td></tr>"
            Response.Write "<tr><td>充值方式：</td><td>"&rs_charge("charge_method")&"</td></tr>"
            Response.Write "<tr><td>服务器名：</td><td>"&rs_charge("servername")&"</td></tr>"
            Response.Write "</table>"
        End If
    End If
    If rs("goods_type")=2 Then	'汇款的记录号		
        Response.Write "<tr><td>汇款帐号信息</td><td><table width='100%'>"
        sql_huikuan="select * from huikuan where orders_id="&orders_id
        Set rs_huikuan=conn.execute(sql_huikuan)
        If Not rs_huikuan.eof Then
            Response.Write "<tr><td width=150>银行/代购名称</td><td width=350>"&rs_huikuan("bank_name")&"</td></tr>"
            Response.Write "<tr><td>开户行</td><td>"&rs_huikuan("province")&"</td></tr>"			 
            Response.Write "<tr><td>收款人银行帐号</td><td>"&rs_huikuan("account_name")&"</td></tr>"
            Response.Write "<tr><td>收款人姓名</td><td>"&rs_huikuan("name")&"</td></tr>"
            Response.Write "<tr><td>金额</td><td>"&rs_huikuan("amount")&"</td></tr>"
            Response.Write "<tr><td>商品/服务网址</td><td >"&rs_huikuan("usages")&"</td></tr>"
            Response.Write "<tr><td>备注</td><td ><font color='red'>"&rs_huikuan("memo_text")&"</font></td></tr>"
        End If
        Response.Write "</table>"
        rs_huikuan.close
    End If	
    %>
    <tr>
        <td>
            付款方式
        </td>
        <td>
            <%
    select case rs("pay_method")
        case 0	Response.Write "不详"
        case 1	Response.Write "电汇(T/T)"
        case 2	Response.Write "Paypal"
        case 3	Response.Write "Xpay"
        case 4	Response.Write "国内卡"
        case 5	Response.Write "管理员手工"
        case 6	Response.Write "赠送"
        case 7	Response.Write "国内卡(财付通)"
        case 8	Response.Write "Google checkout"
        case 9	Response.Write "会员帐户"
        case 10	Response.Write "西联汇款"
        case 11	Response.Write "英国汇款"
        case 12	Response.Write "加元汇款"
        case 13	Response.Write "澳元汇款"
        case 14	Response.Write "美国汇款"
        case 15	Response.Write "Moneybooker"
        case Else Response.Write "不详"
    end select
            %>
        </td>
    </tr>
    <tr>
        <td>
            定单日期(北京时间)
        </td>
        <td>
            <%=GetBeijingTime(rs("order_time"))%>
        </td>
    </tr>
    <tr>
        <td>
            处理日期(北京时间)
        </td>
        <td>
            <%=GetBeijingTime(rs("process_time"))%>&nbsp;
        </td>
    </tr>
    <tr>
        <td>
            付款状态
        </td>
        <%	
    If rs("pay_status")=0 Then
        Response.Write "<td>未付款</td>"
    Else 
        If rs("pay_status")=1 or rs("pay_status")=2 Then
            Response.Write "<td>已付款</td>"
        Else
            Response.Write "<td>处理中</td>"
        End If
    End If
    Response.Write "</tr><tr><td>处理状态</td>"
    If rs("status")=0 Then
        Response.Write "<td>未处理</td>"
    ElseIf rs("status")=2 or rs("status")=5 or rs("status")=9 Then
        Response.Write "<td>处理中</td>"
    ElseIf rs("status")=1 or rs("status")=3 Then
        Response.Write "<td>已处理</td>"
    Else
        Response.Write "<td>不详</td>"
    End If
        %>
    </tr>
    <tr>
        <td>
            您填的备注
        </td>
        <td>
            <%=rs("memo_cust")%>&nbsp;
        </td>
    </tr>
    <tr>
        <td>
            客服给您的备注
        </td>
        <td>
            <font color='red'>
                <%=rs("memo_tocust")%></font>&nbsp;
        </td>
    </tr>
</table>
<%
    If rs("status")<>0 Then
        sql3="select cust_id from customer where username='"&Session("username")&"' and  cust_id="&Session("cust_id")
        Set rs3=conn.execute(sql3)
        If Not rs3.eof Then
%>
<table width="400" border="1" align="center" cellspacing="0" class="little">
    <tr>
        <td>
            编号
        </td>
        <td>
            卡号
        </td>
        <td>
            密码
        </td>
    </tr>
    <%			
            sql_card="select * from card_detail where orders_id="&orders_id&" and status=0"
            Set rs2=conn.execute(sql_card)			
            while Not rs2.eof 
                count=count+1
                Response.Write "<tr><td>"&count&"</td>"
                Response.Write "<td>"&rs2("username")&"</td>"
                Response.Write "<td>"&DeCrypt(rs2("password"))&"</td></tr>"

                rs2.movenext
            wend
            Response.Write "</table>"
            
        Else
            Response.Write "错误!"
        End If		
    Else
        Response.Write "<center>此定单还未处理!"
    End If

    sql_comp="select content_time,content COLLATE utf8_general_ci,pro_content COLLATE utf8_general_ci,status from complain where orders_id="&orders_id&" order by complain_id desc"
    Set rs_comp=conn.execute(sql_comp)
    while Not rs_comp.eof
        Response.Write "<br /><table width='400' border='1' align='center' cellspacing='0' class='little'>"
        Response.Write "<tr><td width='100'>投诉时间</td><td>"&GetBeijingTime(rs_comp("content_time"))&"</td></tr>"
        Response.Write "<tr><td>投诉内容</td><td>"&rs_comp("content COLLATE utf8_general_ci")&"</td></tr>"
        If rs_comp("status")=1 Then
            Response.Write "<tr><td>处理状态</td><td>已经处理</td></tr>"
            Response.Write "<tr><td>回复内容</td><td>"&rs_comp("pro_content COLLATE utf8_general_ci")&"</td></tr>"
        ElseIf	rs_comp("status")=2 Then
            Response.Write "<tr><td>处理状态</td><td>处理中</td></tr>"
        ElseIf	rs_comp("status")=0 Then
            Response.Write "<tr><td>处理状态</td><td>未处理</td></tr>"
        Else
            Response.Write "<tr><td>处理状态</td><td>不详</td></tr>"
        End If
        Response.Write "</table>"
        rs_comp.movenext
    wend
Else
    Response.Write "错误!"
End If

    %>
    <br />
    <center>
        <font color='red'>工作人员无法看到您的卡号和密码!<br />
            如果是卡密无法充值,请把卡号和密码复制过来一起提交给我们.</font><br />
        <br />
        <form action="orders_compl_save.asp" method="post">
        <input name="orders_id" value="<%=orders_id%>" type="hidden">
        <input name="card_name" value="<%=card_name%>" type="hidden">
        请填写投诉内容:<br />
        <textarea name="comp_content" cols="40" rows="7"></textarea><br />
        <input type="submit" value="提交">
        </form>
    </center>
    <!--#include file="bottom.asp"-->
